feat(searchHubber): implement search functionality for hubbers by Name or Handle#4
feat(searchHubber): implement search functionality for hubbers by Name or Handle#4
Conversation
…bers by Name or Handle
|
|
||
| [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseDeclaredVarsMoreThanAssignments','',Scope='function')] | ||
| $WarningParameters = @{ | ||
| WarningAction = 'SilentlyContinue' |
Check notice
Code scanning / PSScriptAnalyzer
Line has trailing whitespace Note
|
|
||
| $TEST_TRANSCRIPT_FILE = "test_transcript.log" | ||
|
|
||
| function Start-MyTranscript { |
Check warning
Code scanning / PSScriptAnalyzer
Function 'Start-MyTranscript' has verb that could change system state. Therefore, the function has to support 'ShouldProcess'. Warning
| Start-Transcript -Path $TEST_TRANSCRIPT_FILE | ||
| } | ||
|
|
||
| function Stop-MyTranscript { |
Check warning
Code scanning / PSScriptAnalyzer
Function 'Stop-MyTranscript' has verb that could change system state. Therefore, the function has to support 'ShouldProcess'. Warning
| Mock_Database | ||
|
|
||
| Start-MyTranscript | ||
| $result = search-Hubber @ErrorParameters |
Check warning
Code scanning / PSScriptAnalyzer
The variable 'result' is assigned but never used. Warning
| [CmdletBinding()] | ||
| param ( | ||
| [Parameter(Position=0)][string]$Handle, | ||
| [Parameter(ValueFromPipeline,ValueFromPipelineByPropertyName,Position=0)][string]$Handle, |
Check warning
Code scanning / PSScriptAnalyzer
Command accepts pipeline input but has not defined a process block. Warning
| [CmdletBinding()] | ||
| param ( | ||
| [Parameter(Position=0)][string]$Handle, | ||
| [Parameter(ValueFromPipeline,ValueFromPipelineByPropertyName,Position=0)][string]$Handle, |
Check warning
Code scanning / PSScriptAnalyzer
Command accepts pipeline input but has not defined a process block. Warning
| @@ -0,0 +1,29 @@ | |||
| function Search-Hubber { | |||
Check notice
Code scanning / PSScriptAnalyzer
The cmdlet 'Search-Hubber' does not have a help comment. Note
|
|
||
| $isName = -not [string]::IsNullOrEmpty($Name) | ||
| $isHandle = -not [string]::IsNullOrEmpty($Handle) | ||
|
|
Check notice
Code scanning / PSScriptAnalyzer
Line has trailing whitespace Note
| Write-MyError -Message "Please specify either Name or Handle, or both." | ||
| return $null | ||
| } | ||
|
|
Check notice
Code scanning / PSScriptAnalyzer
Line has trailing whitespace Note
Introduce the Search-Hubber function to allow querying hubbers based on their Name or Handle. Update the Get-Hubber function to enhance parameter handling. Add unit tests to validate the search functionality across various scenarios.